home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / fileutil.13 / fileutil / fileutils-3.13 / src / cp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-24  |  2.3 KB  |  76 lines

  1. /* cp.h  -- file copying (data definitions)
  2.    Copyright (C) 89, 90, 91, 1995 Free Software Foundation.
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 2, or (at your option)
  7.    any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software Foundation,
  16.    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  
  18.    Written by Torbjorn Granlund, Sweden (tege@sics.se). */
  19.  
  20. #include <sys/types.h>
  21. #include "system.h"
  22. #include "error.h"
  23.  
  24. struct dir_list
  25. {
  26.   struct dir_list *parent;
  27.   ino_t ino;
  28.   dev_t dev;
  29. };
  30.  
  31. struct entry
  32. {
  33.   ino_t ino;
  34.   dev_t dev;
  35.   char *node;            /* Path name, or &new_file for new inodes.  */
  36.   struct entry *coll_link;    /* 0 = entry not occupied.  */
  37. };
  38.  
  39. struct htab
  40. {
  41.   unsigned modulus;        /* Size of the `hash' pointer vector.  */
  42.   struct entry *entry_tab;    /* Pointer to dynamically growing vector.  */
  43.   unsigned entry_tab_size;    /* Size of current `entry_tab' allocation.  */
  44.   unsigned first_free_entry;    /* Index in `entry_tab'.  */
  45.   struct entry *hash[1];    /* Vector of pointers in `entry_tab'.  */
  46. };
  47.  
  48. extern struct htab *htab;
  49.  
  50. /* For created inodes, a pointer in the search structure to this
  51.    character identifies that the inode as new.  */
  52. extern char new_file;
  53.  
  54. char *basename ();
  55. char *xmalloc ();
  56. char *xrealloc ();
  57. char *stpcpy ();
  58. char *savedir ();
  59. int yesno ();
  60. void hash_init ();
  61. void strip_trailing_slashes ();
  62.  
  63. void forget_all __P ((void));
  64. void usage __P ((int status, const char *reason));
  65. int is_ancestor __P ((const struct stat *sb,
  66.               const struct dir_list *ancestors));
  67. char *hash_insert __P ((ino_t ino, dev_t dev, const char *node));
  68. char *hash_insert2 __P ((struct htab *htab, ino_t ino, dev_t dev,
  69.              const char *node));
  70. char *remember_copied __P ((const char *node, ino_t ino, dev_t dev));
  71. int remember_created __P ((const char *path));
  72.  
  73. #ifndef S_IWRITE
  74. #define S_IWRITE S_IWUSR
  75. #endif
  76.